package com.googlecode.ssdutils.beanconverter.example.presentation.actionlistener;

import java.awt.event.ActionEvent;

public class DeleteListButtonActionListener extends TableActionListener {
	public void actionPerformed(ActionEvent e) {
		int selectedRow = table.getSelectedRow();

		if (selectedRow == -1) {
			// if there is no selected row, don't do anything
			return;
		}

		if (table.isEditing()) {
			// if we are editing the table, don't do anything
			return;
		}

		todoListBS.deleteList(selectedRow);
		table.revalidate();
		table.repaint();
	}
}